$tell_hooks = []
DownstreamHook.remove('tell')
DownstreamHook.add('tell', Proc.new {|cs|
  found = false
  ret = if cs.clean_colors =~ /^\{tell\}(.+) tells? (.+) '(.+)'$/
    send, rec, msg, found = $1, $2, $3, true
    cs.gsub!(/\{tell\}/, '')
    if send == 'You' && rec == Char.name
      nil
    elsif send == Char.name && rec == 'you'
      $tell_hooks.delete(msg).nil? ? cs : nil
    else
      cs
    end
  else
    cs
  end
  $app.add_boxes['chat'].display_text(ret) if found and !ret.nil?
  ret
})

def tell_wait(tell_id)
  $tell_hooks << tell_id unless $tell_hooks.include?(tell_id)
  $app.send_text("tell #{Char.name} #{tell_id}\n", true)
  wait_while {$tell_hooks.include?(tell_id)}
end